#define _CRT_SECURE_NO_WARNINGS 1
#include <string>
#include <iostream>

using namespace std;

int main() {
    std::string str = "AACTGTGCACGACCTGA";
    int n = 5;
    //cin >> str >> n;

    int left = 0, right = 0, len = 0, maxlen = 0, pos = 0;
    while (right < str.size())
    {

        if ((right - left) == n)
        {
            if (maxlen < len)
            {
                maxlen = len;
                pos = left;
            }
            if(str[left] == 'G' || str[left] == 'C') len--;
            left++;
        }
        if (str[right] == 'G' || str[right] == 'C') len++;
        right++;
    }
    if (maxlen < len)
    {
        pos = left;
    }

    for (int i = pos; i < pos + n; i++)
    {
        cout << str[i];
    }

    return 0;


}
